﻿
using System;
using System.Collections.Generic;
using System.ComponentModel;
namespace MyFramework.Common.Interfaces
{
    /// <summary>
    /// Interface view model
    /// </summary>
    public interface IViewModel : IEntity, IDataErrorInfo
    {
        #region

        /// <summary>
        /// Gets the views.
        /// </summary>
        /// <value>
        /// The views.
        /// </value>
        IViewCollection Views { get; }

        /// <summary>
        /// Gets or sets the model.
        /// </summary>
        /// <value>
        /// The model.
        /// </value>
        IModel Model { get; set; }

        #endregion

        #region Event

        /// <summary>
        /// Occurs when [model set].
        /// </summary>
        event EventHandler ModelSet;

        /// <summary>
        /// Occurs when [view model ready].
        /// </summary>
        event EventHandler ViewModelReady;

        #endregion

        #region Methods

        /// <summary>
        /// Raises the view model ready.
        /// </summary>
        void RaiseViewModelReady();

        /// <summary>
        /// Initializes the specified parameter.
        /// </summary>
        /// <param name="parameter">The parameter.</param>
        void Initialize(IDictionary<string, object> parameter);

        /// <summary>
        /// Sets the index main view.
        /// </summary>
        /// <param name="index">The index.</param>
        void SetIndexMainView(int index = 0);

        /// <summary>
        /// Gets the main view.
        /// </summary>
        /// <value>
        /// The main view.
        /// </value>
        IView GetMainView();

        #endregion
    }
}
